package zhoufu.sz.sanxiao_check.ui;

import zhoufu.sz.sanxiao_check.R;
import zhoufu.sz.sanxiao_check.inject.HasComponent;
import zhoufu.sz.sanxiao_check.inject.components.DaggerLoginComponet;
import zhoufu.sz.sanxiao_check.inject.components.LoginComponet;
import zhoufu.sz.sanxiao_check.ui.fragment.LoginFragment;
import zhoufu.sz.sanxiao_check.utils.UIUtils;

/**
 * User:RCP
 * email:ruancaipu@gmail.com
 * Date:2016/7/19
 * Des:登录
 */
public class LoginActivity extends BaseActivity implements HasComponent<LoginComponet> {
    private LoginComponet loginComponet;
//    private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();

    @Override
    protected void initInject() {
        UIUtils.savebadge(this);
        LoginFragment fragment = new LoginFragment();
        addFragment(R.id.login_frame, fragment);
        loginComponet = DaggerLoginComponet.builder().activityModule(getActivityModule())
                .appComponent(getAppComponent()).build();
//        for (int i = 0; i < 129+(CPU_COUNT*2+1); i++) {
////            new MyAsyncTask().execute("dddddd"+i);
//            new MyAsyncTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,"dddddd"+i);
//        }
    }

    @Override
    protected int setIndividualId() {
        return R.layout.activity_login;
    }

    @Override
    public LoginComponet getComponent() {
        return loginComponet;
    }

//    class MyAsyncTask extends AsyncTask {
//
//        @Override
//        protected Object doInBackground(Object[] params) {
//            try {
//                Thread.sleep(3000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
//            Log.e("---------", "doInBackground: "+params[0] );
//            return null;
//        }
//    }
}
